package Native
{
	import Objects.GameObject;
	import Objects.GameTextField;
	
	import flash.text.TextField;

	public class NativeField extends TextField implements INativeObject
	{
		public var lastText:String="";
		public function NativeField()
		{
			super();
		}
		private var m_go:GameObject;
		public function set go(value:GameObject):void
		{
			m_go=value;
		}
		public function get go():GameObject
		{
			return m_go;
		}
		override public function set text(value:String):void
		{
			if(lastText==value)return;
			
			lastText=value;
			
			defaultTextFormat=textField.format;
			
			super.text=value;
		}
		override public function set htmlText(value:String):void
		{
			if(lastText==value)return;
			
			lastText=value;
			
			defaultTextFormat=textField.format;
			
			super.htmlText=value;
		}
		public function get textField():GameTextField
		{
			return go as GameTextField;
		}
	}
}